﻿using System.Collections.Concurrent;

namespace IOP.OpenType.Tables
{
    /// <summary>
    /// 字形表
    /// </summary>
    public class GlyfTable
    {
        /// <summary>
        /// 字形说明
        /// </summary>
        public ConcurrentDictionary<uint, GlyphDescription> Descriptions { get; set; } = new ConcurrentDictionary<uint, GlyphDescription>();
    }

    /// <summary>
    /// 字形说明
    /// </summary>
    public abstract class GlyphDescription
    {
        /// <summary>
        /// 
        /// </summary>
        public GlyphHeader Header { get; set; }
    }

    /// <summary>
    /// 简单字形说明
    /// </summary>
    public class SimpleGlyphDescription : GlyphDescription
    {
        /// <summary>
        /// 
        /// </summary>
        public ushort[] EndPtsOfContours { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public ushort InstructionLength { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public byte[] Instructions { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public byte[] Flags { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public short[] XCoordinates { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public short[] YCoordinates { get; set; }
    }
}
